package ModelLayer; 		//makes this class a part of the ModelLayer package

/**
 * Write a description of class SaleOrder here.
 * @author (ucn-1semprojekt-dm78-gruppe1) 
 */
@SuppressWarnings("serial")
public class SaleOrder extends Order
{
    private String deliveryDate;
    private double offer;
    
    /**
     * Constructor for objects of class SaleOrder
     */
    public SaleOrder(int ordernr, String date, double totalPrice, Employee employee, int deliveryDiscount, String deliveryDate, Customer customer, double offer)
    {
        super(ordernr, date, totalPrice, employee, deliveryDiscount, customer);
        this.deliveryDate = deliveryDate;
        this.offer = offer;
    }

    /**
     * Get the delivery date of the items on the Order
     * @return deliveryDate
     */
    public String getDeliveryDate()
    {
        return deliveryDate;
    }
    
    /**
     * Get the offer of the items on the Order
     * @return offer
     */
    public double getOffer()
    {
        return offer;
    }
    
    /**
     * Set the delivery date of the items on the Order
     * @param newDeliveryDate
     */
    public void setDeliveryDate(String newDeliveryDate)
    {
        deliveryDate = newDeliveryDate;
    }
    
    /**
     * Set the offer of the items on the Order
     * @param newOffer
     */
    public void setOffer(double newOffer)
    {
        offer = newOffer;
    }
    
    public double calculateTotalPrice()
    {
        double total = super.calculatePrice();
        total -= offer;
        return total;
    }
}
